﻿// DlgOptStore.cpp: 实现文件
//

#include "stdafx.h"
#include "GHCY.h"
#include "afxdialogex.h"
#include "DlgOptStore.h"


// DlgOptStore 对话框

IMPLEMENT_DYNAMIC(DlgOptStore, CDialogEx)

DlgOptStore::DlgOptStore(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_OPT_STORE, pParent)
	, m_nToBlank(theApp.m_nToBlank)
	, m_nToCurrent(theApp.m_nToCurrent)
	, m_nMaxTime(theApp.m_nMaxTime)
	, m_nWaitOut(theApp.m_nWaitOut)
	, m_nChargeWaitNewTask(theApp.m_nChargeWaitNewTask)
	, m_nAllowAvoidArea(theApp.m_nAllowAvoidArea)
	, m_bBreakRecharge(theApp.m_bBreakRecharge)
{
	
}

DlgOptStore::~DlgOptStore()
{
}

void DlgOptStore::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Check(pDX, IDC_CHECK5, m_nToBlank);
	DDX_Check(pDX, IDC_CHECK8, m_nToCurrent);
	DDX_Check(pDX, IDC_CHECK9, m_nMaxTime);
	DDX_Check(pDX, IDC_CHECK2, m_nWaitOut);
	DDX_Check(pDX, IDC_CHECK6, m_nChargeWaitNewTask);
	DDX_Check(pDX, IDC_CHECK7, m_nAllowAvoidArea);
	DDX_Check(pDX, IDC_CHECK14, m_bBreakRecharge);
}


BEGIN_MESSAGE_MAP(DlgOptStore, CDialogEx)
	ON_BN_CLICKED(IDOK, &DlgOptStore::OnBnClickedOk)
END_MESSAGE_MAP()


// DlgOptStore 消息处理程序

void DlgOptStore::OnBnClickedOk()
{
	UpdateData();

	theApp.m_nToBlank = m_nToBlank;
	theApp.setSysInt(L"m_nToBlank", m_nToBlank);

	theApp.m_nToCurrent = m_nToCurrent;
	theApp.setSysInt(L"m_nToCurrent", m_nToCurrent);

	theApp.m_nMaxTime = m_nMaxTime;
	theApp.setSysInt(L"m_nMaxTime", m_nMaxTime);

	theApp.m_nWaitOut = m_nWaitOut;
	theApp.setSysInt(L"m_nWaitOut", m_nWaitOut);

	theApp.m_nChargeWaitNewTask = m_nChargeWaitNewTask;
	theApp.setSysInt(L"m_nChargeWaitNewTask", (int&)m_nChargeWaitNewTask);

	theApp.m_nAllowAvoidArea = m_nAllowAvoidArea;
	theApp.setSysInt(L"m_nAllowAvoidArea", (int&)m_nAllowAvoidArea);

	theApp.m_bBreakRecharge = m_bBreakRecharge;
	theApp.setSysInt(L"m_bBreakRecharge", (int&)m_bBreakRecharge);

	EndDialog(IDOK);
}
